package org.example.web;

import org.example.entity.Question;
import org.example.service.IQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/question")
public class QuestionController {
    @Autowired
    private IQuestionService IQuestionService;

    @RequestMapping("/list")
    public String list(Model model){
        List<Question> questionList = IQuestionService.list();
        model.addAttribute("questionList",questionList);
        return "question";
    }
}
